package com.mashuai.utils.base;
import com.mashuai.utils.config.constants.ApplicationConstant;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName: MsLogUtils
 * @Description: 日志工具类。可与三方平台日志框架集合
 */
@Slf4j
public class MsLogUtils {

    public static void info(String msg) {
        log.info(msg);
    }

    public static void info(String format, Object... arguments) {
        log.info(format, arguments);
    }


    public static void error(String msg) {
        log.error(msg);
    }

    public static void error(String format, Object... arguments) {
        log.error(format, arguments);
    }

    public static void debug(String msg) {
        log.debug(msg);
    }

    public static void debug(String format, Object... arguments) {
        log.debug(format, arguments);
    }

    public static void warn(String msg) {
        log.warn(msg);
    }

    public static void warn(String format, Object... arguments) {
        log.warn(format, arguments);
    }

    /**
     * 工具类内部所有的日志打印全都用这个方法
     **/
    public static void innerInfo(String msg) {
        if ("true".equals(ApplicationConstant.msLogOpenInnerPrint)) log.info(msg);
    }

    public static void innerInfo(String format, Object... arguments) {
        if ("true".equals(ApplicationConstant.msLogOpenInnerPrint)) log.info(format, arguments);
    }


}
